<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>DepthSense SDK: The DepthSense SDK Reference Manual</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo_softkinetic-198x55.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">DepthSense SDK
   
   </div>
   <div id="projectbrief">The DepthSense Software Development Kit</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">The DepthSense SDK Reference Manual </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h2><a class="anchor" id="overview"></a>
Overview</h2>
<p>DepthSense SDK provides an interface to the various SoftKinetic DepthSense cameras. By using the DepthSense library, you can configure one or more DepthSense cameras and capture depth, color and audio frame data.</p>
<p>Some of the DepthSense SDK features are:</p>
<ul>
<li>
a type system transparently combining automatic memory management and polymorphism, and providing some reflection capabilities </li>
<li>
an elegant event-based framework for receiving frame data and server notifications </li>
<li>
a property system supporting reflection </li>
<li>
multi-camera and multi-client support </li>
</ul>
<p>These features will be examined in more detail in the following sections.</p>
<h2><a class="anchor" id="type-system"></a>
The DepthSense SDK type system</h2>
<p>The DepthSense SDK type system provides automatic memory management (which is implemented with traditional smart pointer mechanisms) while preserving the syntactical advantages of C++ polymorphism.</p>
<p>DepthSense SDK objects reside on the stack and are passed by value (like smart pointers), but offer polymorphism abilities similar to what C++ offers with heap-based pointers. The following examples compare C++ and DepthSense with commonly-used idioms.</p>
<h3><a class="anchor" id="init-unset-var"></a>
Initializing an object variable to the unset state</h3>
<h4><a class="anchor" id="init-unset-var-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> MyClass* obj = NULL;
</pre></div><h4><a class="anchor" id="init-unset-var-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> MyClass obj;
</pre></div><h3><a class="anchor" id="testing-if-set"></a>
Testing if an object variable is set</h3>
<h4><a class="anchor" id="testing-if-set-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">bool</span> b = obj != NULL;
</pre></div><h4><a class="anchor" id="testing-if-set-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">bool</span> b = obj.isSet();
</pre></div><h3><a class="anchor" id="unset-var"></a>
Unsetting an object variable</h3>
<h4><a class="anchor" id="unset-var-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> obj = NULL;
</pre></div><h4><a class="anchor" id="unset-var-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> obj.unset();
</pre></div><h3><a class="anchor" id="upcast"></a>
Performing an upcast</h3>
<h4><a class="anchor" id="upcast-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> MyDerivedClass* derived = param1;
 MyBaseClass* base = derived;
</pre></div><h4><a class="anchor" id="upcast-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> MyDerivedClass derived = param1;
 MyBaseClass base = derived;
</pre></div><h3><a class="anchor" id="derived-call"></a>
Calling a method of the most derived class</h3>
<h4><a class="anchor" id="derived-call-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> obj-&gt;derivedMethod();
</pre></div><h4><a class="anchor" id="derived-call-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> obj.derivedMethod();
</pre></div><h3><a class="anchor" id="base-call"></a>
Calling a method of a base class</h3>
<h4><a class="anchor" id="base-call-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> obj-&gt;baseMethod();
</pre></div><h4><a class="anchor" id="base-call-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> obj.baseMethod();
</pre></div><h3><a class="anchor" id="rtt-test"></a>
Testing the runtime type of an object</h3>
<h4><a class="anchor" id="rtt-test-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> MyBaseClass* base = param1;
 <span class="keywordtype">bool</span> b = <span class="keyword">dynamic_cast&lt;</span>MyDerivedClass*<span class="keyword">&gt;</span>(base) != NULL;
</pre></div><h4><a class="anchor" id="rtt-test-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> MyBaseClass base = param1;
 <span class="keywordtype">bool</span> b = base.is&lt;MyDerivedClass&gt;();
</pre></div><h3><a class="anchor" id="downcast"></a>
Performing a downcast which cannot fail</h3>
<h4><a class="anchor" id="downcast-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> <span class="comment">// if the cast fails, derived is NULL and the code crashes</span>
 MyBaseClass* base = param1;
 MyDerivedClass* derived = <span class="keyword">dynamic_cast&lt;</span>MyDerivedClass*<span class="keyword">&gt;</span>(base);
 derived-&gt;someMethod();
</pre></div><h4><a class="anchor" id="downcast-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> <span class="comment">// if the cast fails, std::bad_cast is thrown</span>
 MyBaseClass base = param1;
 MyDerivedClass derived = (MyDerivedClass) base;
 derived.someMethod();
</pre></div><h3><a class="anchor" id="downcast-attempt"></a>
Performing a downcast which can fail</h3>
<h4><a class="anchor" id="downcast-attempt-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> MyBaseClass* base = param1;
 MyDerivedClass* derived = <span class="keyword">dynamic_cast&lt;</span>MyDerivedClass*<span class="keyword">&gt;</span>(base);
 <span class="keywordtype">bool</span> castSucceeded = derived != NULL;
</pre></div><h4><a class="anchor" id="downcast-attempt-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> MyBaseClass base = param1;
 MyDerivedClass derived = base.as&lt;MyDerivedClass&gt;();
 <span class="keywordtype">bool</span> castSucceeded = derived.isSet();
</pre></div><h3><a class="anchor" id="get-type-name"></a>
Obtaining the name of the runtime type of an object</h3>
<h4><a class="anchor" id="get-type-name-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> <span class="comment">// the name is implementation-defined and often mangled</span>
 <span class="keyword">const</span> <span class="keywordtype">char</span>* name = <span class="keyword">typeid</span>(*obj).name();
</pre></div><h4><a class="anchor" id="get-type-name-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> <span class="comment">// the name is formalized and of the form DepthSense.ColorNode</span>
 std::string name = obj.getType().name();
</pre></div><h3><a class="anchor" id="get-properties"></a>
Obtaining the list of properties of an interface</h3>
<h4><a class="anchor" id="get-properties-cxx"></a>
C++ code</h4>
<div class="fragment"><pre class="fragment"> <span class="comment">// C++ provides no such facility</span>
</pre></div><h4><a class="anchor" id="get-properties-ds"></a>
DepthSense SDK code</h4>
<div class="fragment"><pre class="fragment"> std::vector&lt;DepthSense::PropertyBase&gt; properties = MyClass::type().getProperties();
</pre></div><h2><a class="anchor" id="event-system"></a>
The DepthSense SDK event system</h2>
<p>DepthSense SDK features an event-based framework for providing the client application with frame data and server notifications.</p>
<p>The following example demonstrates how to capture the data coming from the first available color sensor attached to the host system.</p>
<div class="fragment"><pre class="fragment">
<span class="comment">// SoftKinetic DepthSense SDK</span>
<span class="comment">//</span>
<span class="comment">// COPYRIGHT AND CONFIDENTIALITY NOTICE - SOFTKINETIC CONFIDENTIAL</span>
<span class="comment">// INFORMATION</span>
<span class="comment">//</span>
<span class="comment">// All rights reserved to SOFTKINETIC SENSORS NV (a</span>
<span class="comment">// company incorporated and existing under the laws of Belgium, with</span>
<span class="comment">// its principal place of business at Boulevard de la Plainelaan 15,</span>
<span class="comment">// 1050 Brussels (Belgium), registered with the Crossroads bank for</span>
<span class="comment">// enterprises under company number 0811 341 454 - &quot;Softkinetic</span>
<span class="comment">// Sensors&quot;).</span>
<span class="comment">//</span>
<span class="comment">// The source code of the SoftKinetic DepthSense Camera Drivers is</span>
<span class="comment">// proprietary and confidential information of Softkinetic Sensors NV.</span>
<span class="comment">//</span>
<span class="comment">// For any question about terms and conditions, please contact:</span>
<span class="comment">// info@softkinetic.com Copyright (c) 2002-2015 Softkinetic Sensors NV</span>
<span class="comment"></span>
<span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<span class="preprocessor">#include &lt;iostream&gt;</span>

<span class="preprocessor">#include &lt;DepthSense.hxx&gt;</span>

<span class="keyword">using namespace </span>std;
<span class="keyword">using namespace </span>DepthSense;

<span class="keyword">static</span> <span class="keywordtype">void</span> error (<span class="keyword">const</span> <span class="keywordtype">char</span>* message)
{
    cerr &lt;&lt; message &lt;&lt; endl;
    exit(1);
}

<span class="keyword">static</span> <a class="code" href="classDepthSense_1_1ColorNode.html" title="Represents a color stream data source.">ColorNode</a> getFirstAvailableColorNode (<a class="code" href="classDepthSense_1_1Context.html" title="Represents an application session.">Context</a> context)
{
  <span class="comment">// obtain the list of devices attached to the host</span>
  vector&lt;Device&gt; devices = context.<a class="code" href="classDepthSense_1_1Context.html#a51b37695a0f5b4dbda6493b2c844912c" title="Gets the value of the Context::devices property.">getDevices</a>();

  <span class="keywordflow">for</span> (vector&lt;Device&gt;::const_iterator iter = devices.begin(); iter != devices.end(); iter++)
  {
      <a class="code" href="classDepthSense_1_1Device.html" title="Represents a camera device.">Device</a> device = *iter;

      <span class="comment">// obtain the list of nodes of the current device</span>
      vector&lt;Node&gt; nodes = device.<a class="code" href="classDepthSense_1_1Device.html#adf94eabda59cfdd383fec3491911ab4e" title="Gets the value of the Device::nodes property.">getNodes</a>();

      <span class="keywordflow">for</span> (vector&lt;Node&gt;::const_iterator nodeIter = nodes.begin(); nodeIter != nodes.end(); nodeIter++)
      {
          <a class="code" href="classDepthSense_1_1Node.html" title="Represents a stream data source.">Node</a> node = *nodeIter;

          <span class="comment">// if the node is a DepthSense::ColorNode, return it</span>
          <a class="code" href="classDepthSense_1_1ColorNode.html" title="Represents a color stream data source.">ColorNode</a> colorNode = node.as&lt;<a class="code" href="classDepthSense_1_1ColorNode.html" title="Represents a color stream data source.">ColorNode</a>&gt;();
          <span class="keywordflow">if</span> (colorNode.<a class="code" href="classDepthSense_1_1Interface.html#a12a9646f7fee1c7c32cb37793e47a767" title="Checks if the current instance is set.">isSet</a>())
              <span class="keywordflow">return</span> colorNode;
      }
  }

  <span class="comment">// return an unset color node</span>
  <span class="keywordflow">return</span> <a class="code" href="classDepthSense_1_1ColorNode.html" title="Represents a color stream data source.">ColorNode</a>();
}

<span class="keyword">static</span> <span class="keywordtype">void</span> onNewColorSample (<a class="code" href="classDepthSense_1_1ColorNode.html" title="Represents a color stream data source.">ColorNode</a> obj, <a class="code" href="structDepthSense_1_1ColorNode_1_1NewSampleReceivedData.html" title="Holds the DepthSense::ColorNode::NewSampleReceivedEvent arguments.">ColorNode::NewSampleReceivedData</a> data)
{
    cout &lt;&lt; <span class="stringliteral">&quot;New color sample received (timeOfCapture=&quot;</span> &lt;&lt; data.<a class="code" href="structDepthSense_1_1ColorNode_1_1NewSampleReceivedData.html#a6b152f8d8447b01585d2adfa4a00a1ca" title="the time of capture of the sample, expressed in µs">timeOfCapture</a> &lt;&lt; <span class="stringliteral">&quot;)&quot;</span> &lt;&lt; endl;
}

<span class="keywordtype">int</span> main (<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)
{
    <span class="comment">// create a connection to the DepthSense server at localhost</span>
    <a class="code" href="classDepthSense_1_1Context.html" title="Represents an application session.">Context</a> context = Context::create();

    <span class="comment">// get the first available color sensor</span>
    <a class="code" href="classDepthSense_1_1ColorNode.html" title="Represents a color stream data source.">ColorNode</a> colorNode = getFirstAvailableColorNode(context);
  
    <span class="comment">// if no color node was found, fail</span>
    <span class="keywordflow">if</span> (! colorNode.<a class="code" href="classDepthSense_1_1Interface.html#a12a9646f7fee1c7c32cb37793e47a767" title="Checks if the current instance is set.">isSet</a>())
        error(<span class="stringliteral">&quot;no color node found&quot;</span>);

    <span class="comment">// enable the capture of the color map</span>
    colorNode.<a class="code" href="classDepthSense_1_1ColorNode.html#a06702a52f60e81ac3f5aac1200f6ad57" title="Sets the value of the ColorNode::enableColorMap property.">setEnableColorMap</a>(<span class="keyword">true</span>);

    <span class="comment">// connect a callback to the newSampleReceived event of the color node</span>
    colorNode.<a class="code" href="classDepthSense_1_1ColorNode.html#add6880f6600da3588bafaab7601b3875" title="Returns the newSampleReceived event object.">newSampleReceivedEvent</a>().<a class="code" href="classDepthSense_1_1ColorNode_1_1NewSampleReceivedEvent.html#ae3a84874c5daafa48cdb33f8e9341b53" title="Connects a function to the current event.">connect</a>(onNewColorSample);

    <span class="comment">// add the color node to the list of nodes that will be streamed</span>
    context.<a class="code" href="classDepthSense_1_1Context.html#a907c33e91a33ab8e6ae986fa6d774611" title="Starts monitoring a node.">registerNode</a>(colorNode);

    <span class="comment">// start streaming</span>
    context.<a class="code" href="classDepthSense_1_1Context.html#a6e9674066b93018ec1da8002c5ec54e0" title="Starts the capture on the registered nodes.">startNodes</a>();

    <span class="comment">// start the DepthSense main event loop</span>
    context.<a class="code" href="classDepthSense_1_1Context.html#a632dff4237ba581f663f78881a2d3f8d" title="Runs the DepthSense event loop.">run</a>();
}
</pre></div><h2><a class="anchor" id="property-system"></a>
The DepthSense SDK property system</h2>
<p>Each DepthSense class (such as <a class="el" href="classDepthSense_1_1Device.html" title="Represents a camera device.">DepthSense::Device</a> or <a class="el" href="classDepthSense_1_1ColorNode.html" title="Represents a color stream data source.">DepthSense::ColorNode</a>) defines properties of various types.</p>
<p>While the most natural way of querying and modifying the value of a property is to use the relevant accessor methods, DepthSense SDK also supports property reflection. The following example demonstrates how to discover and display object properties at runtime.</p>
<div class="fragment"><pre class="fragment">
<span class="comment">// SoftKinetic DepthSense SDK</span>
<span class="comment">//</span>
<span class="comment">// COPYRIGHT AND CONFIDENTIALITY NOTICE - SOFTKINETIC CONFIDENTIAL</span>
<span class="comment">// INFORMATION</span>
<span class="comment">//</span>
<span class="comment">// All rights reserved to SOFTKINETIC SENSORS NV (a</span>
<span class="comment">// company incorporated and existing under the laws of Belgium, with</span>
<span class="comment">// its principal place of business at Boulevard de la Plainelaan 15,</span>
<span class="comment">// 1050 Brussels (Belgium), registered with the Crossroads bank for</span>
<span class="comment">// enterprises under company number 0811 341 454 - &quot;Softkinetic</span>
<span class="comment">// Sensors&quot;).</span>
<span class="comment">//</span>
<span class="comment">// The source code of the SoftKinetic DepthSense Camera Drivers is</span>
<span class="comment">// proprietary and confidential information of Softkinetic Sensors NV.</span>
<span class="comment">//</span>
<span class="comment">// For any question about terms and conditions, please contact:</span>
<span class="comment">// info@softkinetic.com Copyright (c) 2002-2015 Softkinetic Sensors NV</span>
<span class="comment"></span>
<span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<span class="preprocessor">#include &lt;iostream&gt;</span>

<span class="preprocessor">#include &lt;DepthSense.hxx&gt;</span>

<span class="keyword">using namespace </span>std;
<span class="keyword">using namespace </span>DepthSense;

<span class="keyword">static</span> <span class="keywordtype">void</span> error (<span class="keyword">const</span> <span class="keywordtype">char</span>* message)
{
    cerr &lt;&lt; message &lt;&lt; endl;
    exit(1);
}

<span class="keyword">static</span> <a class="code" href="classDepthSense_1_1Node.html" title="Represents a stream data source.">Node</a> getFirstAvailableNode (<a class="code" href="classDepthSense_1_1Context.html" title="Represents an application session.">Context</a> context)
{
    <span class="comment">// obtain the list of devices attached to the host</span>
    vector&lt;Device&gt; devices = context.<a class="code" href="classDepthSense_1_1Context.html#a51b37695a0f5b4dbda6493b2c844912c" title="Gets the value of the Context::devices property.">getDevices</a>();

    <span class="keywordflow">for</span> (vector&lt;Device&gt;::const_iterator iter = devices.begin(); iter != devices.end(); iter++)
    {
        <a class="code" href="classDepthSense_1_1Device.html" title="Represents a camera device.">Device</a> device = *iter;

        <span class="comment">// obtain the list of nodes of the current device</span>
        vector&lt;Node&gt; nodes = device.<a class="code" href="classDepthSense_1_1Device.html#adf94eabda59cfdd383fec3491911ab4e" title="Gets the value of the Device::nodes property.">getNodes</a>();

        <span class="comment">// return the first node if any</span>
        <span class="keywordflow">if</span> (! nodes.empty())
            <span class="keywordflow">return</span> nodes[0];
    }

    <span class="comment">// return an unset node</span>
    <span class="keywordflow">return</span> <a class="code" href="classDepthSense_1_1Node.html" title="Represents a stream data source.">Node</a>();
}

<span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<span class="keyword">static</span> <span class="keywordtype">bool</span> tryDisplayProperty (<a class="code" href="classDepthSense_1_1Interface.html" title="The base interface class.">Interface</a> iface, <a class="code" href="classDepthSense_1_1PropertyBase.html" title="The base property class.">PropertyBase</a> prop)
{
    <span class="comment">// attempt to downcast the PropertyBase to a Property&lt;T&gt;</span>
    <a class="code" href="classDepthSense_1_1Property.html" title="The strongly-typed property leaf class.">Property&lt;T&gt;</a> derivedProp = prop.as&lt; <a class="code" href="classDepthSense_1_1Property.html" title="The strongly-typed property leaf class.">Property&lt;T&gt;</a> &gt;();
    <span class="keywordflow">if</span> (! derivedProp.<a class="code" href="classDepthSense_1_1PropertyBase.html#ad43283bc0b372833d544485c850764a5" title="Checks if the current property instance is set.">isSet</a>())
        <span class="keywordflow">return</span> <span class="keyword">false</span>;

    <span class="comment">// display the property name and its value</span>
    cout &lt;&lt; <span class="stringliteral">&quot;Property &quot;</span> &lt;&lt; prop.<a class="code" href="classDepthSense_1_1PropertyBase.html#a1ae899343e90cf389baaba6b52effbb4" title="Returns the name of the current property.">name</a>() &lt;&lt; <span class="stringliteral">&quot; has value &quot;</span> &lt;&lt; derivedProp.<a class="code" href="classDepthSense_1_1Property.html#a46220246eeffd8a2ce197361d8d54931" title="Returns the value of the current property in an interface.">getValue</a>(iface) &lt;&lt; endl;

    <span class="keywordflow">return</span> <span class="keyword">true</span>;
}

<span class="keyword">static</span> <span class="keywordtype">void</span> displayProperty (<a class="code" href="classDepthSense_1_1Interface.html" title="The base interface class.">Interface</a> iface, <a class="code" href="classDepthSense_1_1PropertyBase.html" title="The base property class.">PropertyBase</a> prop)
{
    <span class="comment">// handle a few common property types</span>
    <span class="keywordflow">if</span> (tryDisplayProperty&lt;bool&gt;(iface, prop))
        <span class="keywordflow">return</span>;
    <span class="keywordflow">if</span> (tryDisplayProperty&lt;int32_t&gt;(iface, prop))
        <span class="keywordflow">return</span>;
    <span class="keywordflow">if</span> (tryDisplayProperty&lt;string&gt;(iface, prop))
        <span class="keywordflow">return</span>;

    <span class="comment">// the type is unhandled</span>
    cout &lt;&lt; <span class="stringliteral">&quot;Property &quot;</span> &lt;&lt; prop.<a class="code" href="classDepthSense_1_1PropertyBase.html#a1ae899343e90cf389baaba6b52effbb4" title="Returns the name of the current property.">name</a>() &lt;&lt; <span class="stringliteral">&quot; has unhandled type&quot;</span> &lt;&lt; endl;
}

<span class="keyword">static</span> <span class="keywordtype">void</span> displayProperties (<a class="code" href="classDepthSense_1_1Interface.html" title="The base interface class.">Interface</a> iface)
{
    <span class="comment">// retrieve the runtime type of the object</span>
    <a class="code" href="classDepthSense_1_1Type.html" title="Represents a DepthSense instance type.">Type</a> type = iface.<a class="code" href="classDepthSense_1_1Interface.html#a90e7e833aa0110461d736573010d66f4" title="Returns the runtime type of the current instance.">getType</a>();

    <span class="comment">// obtain the list of properties declared by that type</span>
    vector&lt;PropertyBase&gt; properties = type.<a class="code" href="classDepthSense_1_1Type.html#a758b60e11519bd313db28405bfc9a138" title="Gets the properties of the current type and of its type ancestry.">getProperties</a>();

    <span class="comment">// display the properties</span>
    <span class="keywordflow">for</span> (vector&lt;PropertyBase&gt;::const_iterator iter = properties.begin(); iter != properties.end(); iter++)
    {
        <a class="code" href="classDepthSense_1_1PropertyBase.html" title="The base property class.">PropertyBase</a> prop = *iter;
        displayProperty(iface, prop);
    }
}

<span class="keywordtype">int</span> main (<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv)
{
    <span class="comment">// create a connection to the DepthSense server at localhost</span>
    <a class="code" href="classDepthSense_1_1Context.html" title="Represents an application session.">Context</a> context = Context::create();

    <span class="comment">// get the first available sensor</span>
    <a class="code" href="classDepthSense_1_1Node.html" title="Represents a stream data source.">Node</a> node = getFirstAvailableNode(context);

    <span class="comment">// if no node was found, fail</span>
    <span class="keywordflow">if</span> (! node.<a class="code" href="classDepthSense_1_1Interface.html#a12a9646f7fee1c7c32cb37793e47a767" title="Checks if the current instance is set.">isSet</a>())
        error(<span class="stringliteral">&quot;no node found&quot;</span>);

    <span class="comment">// display the properties of the node</span>
    displayProperties(node);
}
</pre></div> <h2><a class="anchor" id="multi"></a>
Multi-camera, multi-client support</h2>
<p>DepthSense SDK can interface with multiple cameras simultaneously. The <a class="el" href="classDepthSense_1_1Context.html#a51b37695a0f5b4dbda6493b2c844912c" title="Gets the value of the Context::devices property.">DepthSense::Context::getDevices()</a> method returns the list of camera devices attached to the host system.</p>
<p>Moreover, a single DepthSense server instance can serve multiple clients simultaneously. To be notified when the server accepts a new client connection, connect to the <code>clientConnected</code> event of the <a class="el" href="classDepthSense_1_1Context.html" title="Represents an application session.">DepthSense::Context</a> class. </p>
</div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Properties</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Feb 10 2015 22:37:23 for DepthSense SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
